gtk/texthandle: Point handle to the middle of the pointing_to rect
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 6 Nov 2020 13:28:46 +0000 (14:28 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 6 Nov 2020 13:28:46 +0000 (14:28 +0100)
At least vertically, this gives again as much space up and down before
moving the selection the the prev/next line.

gtk/gtktexthandle.c

index b900d699eb045786efd4e7f0f9572626339ff012..47cceafa0e7e8e5e448fb79ccd10062461626d82 100644 (file)
@@ -447,7 +447,7 @@ handle_drag_update (GtkGestureDrag *gesture,
   gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
 
   x = start_x + offset_x - handle->dx;
-  y = start_y + offset_y - handle->dy;
+  y = start_y + offset_y - handle->dy + (handle->pointing_to.height / 2);
   g_signal_emit (widget, signals[HANDLE_DRAGGED], 0, x, y);
 }